*     ***************************************************************** *
*     ***************************************************************** *
*       File-Name:      GINI-2020-1813.REP.do                     		*
*       Date:           20/11/2021                                     	*
*       Author:         Osman Z. Gokce                                  *
*       Purpose:        Do-file to replicate results in Table 4 and 5 	*
*						of the paper titled 							*
*						"Documenting Energy Flows between States:		* 
*						The Global Energy Relations Dataset (GERD), 	*
*						1978-2014"										*
*       Input File:     GERD_dirdyad_v2.3 	                        	*
*       Output File:    GERD_dirdyad_v2.3.log                           *
*       Data Output:    Table4.rtf; Table5.rtf							*
*       Previous file:  None  											*
*		Software:		STATA/SE 17.0									*
*       Machine:        Mac Air                                         *
*     ****************************************************************  *
*     ****************************************************************  *

clear all

capture log close
set more off

log using GERD_dirdyad_v2.3.log, replace

use GERD_dirdyad_v2.3.dta

***Model 1
eststo Model1: logit initiation ENERGY_DEPEND contiguity democ1 democ2 democ12 major1 major2 major12 relpower1 tradedep1 econgrate1 srsvva alliance peaceyears spl2 spl3 spl4, vce(cl dyadid) nolog

***Model 2
eststo Model2: logit initiation MA3ENERGYDEP contiguity democ1 democ2 democ12 major1 major2 major12 relpower1 tradedep1 econgrate1 srsvva alliance peaceyears spl2 spl3 spl4, vce(cl dyadid) nolog

***Model 3-6
foreach x in COAL OIL NATGAS ELECTR{
	eststo Model`x': logit initiation `x'DEPENDENCE contiguity democ1 democ2 democ12 major1 major2 major12 relpower1 tradedep1 econgrate1 srsvva alliance peaceyears spl2 spl3 spl4, vce(cl dyadid) nolog
}

***Table 4
esttab Model1 Model2 using Table4.rtf, replace ti("\f1 Table 1: Energy Dependence and Militarized Interstate Dispute Initiation") star(* 0.10 ** 0.05 *** 0.01) label  interaction(" x ") scalars("cmd Estimation" "chi2type Test" "chi2 Chi-squared" "ll Log-likelihood") noomitted pr2 onecell nogaps

***Table 5
esttab ModelCOAL ModelOIL ModelNATGAS ModelELECTR using Table5.rtf, replace ti("\f1 Table 1: Resource-based Energy Dependence and Militarized Interstate Dispute Initiation") star(* 0.10 ** 0.05 *** 0.01) label  interaction(" x ") scalars("cmd Estimation" "chi2type Test" "chi2 Chi-squared" "ll Log-likelihood") noomitted pr2 onecell nogaps


log close
   set more on
